<template>
  <div class="box-container" v-show="showLoading">
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div>
    <div class="box6"></div>
  </div>
</template>

<script>
  export default {
    name: 'Loading',
    data(){
      return {
        showLoading: true
      }
    },
    methods: {
      show(){
        this.showLoading = true
      },
      hidden(){
        this.showLoading = false
      }
    },
    mounted() {
    },
  }

</script>

<style scoped>
  .box-container {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
  }

  [class^="box"] {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .box1 {
    width: 80px;
    height: 80px;
    border: 2px solid purple;
    border-radius: 50%;
    animation: rotate-my 1s infinite alternate;
  }

  .box2 {
    width: 70px;
    height: 70px;
    border: 2px solid red;
    border-radius: 50%;
    animation: rotate-my 1s 0.1s infinite alternate;
  }

  .box3 {
    width: 60px;
    height: 60px;
    border: 2px solid cyan;
    border-radius: 50%;
    animation: rotate-my 1s 0.2s infinite alternate;
  }

  .box4 {
    width: 50px;
    height: 50px;
    border: 2px solid green;
    border-radius: 50%;
    animation: rotate-my 1s 0.3s infinite alternate;
  }

  .box5 {
    width: 40px;
    height: 40px;
    border: 2px solid yellow;
    border-radius: 50%;
    animation: rotate-my 1s 0.4s infinite alternate;
  }

  .box6 {
    width: 30px;
    height: 30px;
    border: 2px solid orange;
    border-radius: 50%;
    animation: rotate-my 1s 0.5s infinite alternate;
  }

  .content{
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 0;
    transform: translate(-50%,0);
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: grey;
  }

  @keyframes rotate-my {
    0% {
      transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
      transform: translate(-50%, -50%) rotate(180deg);
    }

    100% {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }

  [class^="box"] {
    border-top-color: transparent;
    border-right-color: transparent;
  }

</style>
